Skip to content

feat: verify oss#2043

Closed
SkArchon wants to merge 9 commits intomainfrom
milinda/verify-oss-derzade
Closed

feat: verify oss#2043
SkArchon wants to merge 9 commits intomainfrom
milinda/verify-oss-derzade

Conversation

@SkArchon
Copy link
Copy Markdown
Contributor

@SkArchon SkArchon commented Jul 14, 2025

This PR is to verify a PR from a fork due to current limitations on fork CI checks. This is for #1957

Checklist

Summary by CodeRabbit

  • New Features

    • Improved WebSocket subscription handling to preserve authentication context in header expressions for subgraph requests.
  • Tests

    • Added a test verifying authentication context values are correctly passed as headers in WebSocket subscription requests.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jul 14, 2025

Walkthrough

A new subtest was added to the WebSocket tests to verify that authentication context values can be used in header expressions for subgraph requests. Supporting code in the WebSocket handler was updated to clone the expression context from the original request context into the subscription execution context, ensuring correct propagation of authentication-derived values.

Changes

Files/Paths Change Summary
router-tests/websocket_test.go Added a subtest to check use of authentication context in header expressions for subgraph requests.
router/core/websocket.go Updated subscription execution to clone the expression context from the original request context.
README.md Inserted a blank line before the "## Overview" heading (whitespace-only change).

Estimated code review effort

2 (10–30 minutes)


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c72598c and 21ed2dd.

📒 Files selected for processing (1)
  • README.md (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • README.md
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (11)
  • GitHub Check: build-router
  • GitHub Check: build_push_image (nonroot)
  • GitHub Check: build_push_image
  • GitHub Check: image_scan
  • GitHub Check: image_scan (nonroot)
  • GitHub Check: integration_test (./events)
  • GitHub Check: integration_test (./telemetry)
  • GitHub Check: integration_test (./. ./fuzzquery ./lifecycle ./modules)
  • GitHub Check: build_test
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: Analyze (go)

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between cc2a400 and 5c3b845.

📒 Files selected for processing (2)
  • router-tests/websocket_test.go (3 hunks)
  • router/core/websocket.go (1 hunks)
🧰 Additional context used
🪛 GitHub Actions: Router CI
router/core/websocket.go

[error] 990-990: go vet error: cannot use origCtx.expressionContext.Clone() (value of type *github.com/wundergraph/cosmo/router/internal/expr.Context) as github.com/wundergraph/cosmo/router/internal/expr.Context value in assignment

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (10)
  • GitHub Check: build-router
  • GitHub Check: build_test
  • GitHub Check: build_push_image
  • GitHub Check: integration_test (./events)
  • GitHub Check: integration_test (./. ./fuzzquery ./lifecycle ./modules)
  • GitHub Check: integration_test (./telemetry)
  • GitHub Check: image_scan
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: Analyze (go)
  • GitHub Check: build_test
🔇 Additional comments (3)
router-tests/websocket_test.go (3)

4-4: LGTM: Context import added appropriately.

The context import is correctly added to support the new TestAuthenticator implementation.


86-96: LGTM: Well-implemented test authenticator.

The TestAuthenticator is correctly implemented with:

  • Proper interface compliance with authentication.Authenticator
  • Fixed test claims that are predictable for testing
  • Clean and simple implementation suitable for test purposes

863-919: LGTM: Comprehensive test for authentication context in header expressions.

This test effectively validates that authentication context values can be used in header expressions for subgraph requests during WebSocket subscription execution. Key strengths:

  • Proper test setup: Configures header rules with authentication context expressions
  • Verification strategy: Uses GlobalMiddleware to assert headers are correctly set
  • Complete flow testing: Establishes WebSocket connection, sends subscription, and verifies response
  • Good assertions: Validates both request.auth.isAuthenticated and request.auth.claims.favorite_animal expressions

The test follows the established patterns in the file and provides good coverage for the new functionality.

Comment thread router/core/websocket.go
@SkArchon SkArchon requested review from a team as code owners July 14, 2025 09:33
@SkArchon SkArchon requested a review from JivusAyrus July 14, 2025 09:33
@SkArchon SkArchon force-pushed the milinda/verify-oss-derzade branch from e230eab to 5c3b845 Compare July 14, 2025 09:36
@SkArchon SkArchon changed the title feat: verify oss feat: verify oss Jul 14, 2025
@SkArchon SkArchon force-pushed the milinda/verify-oss-derzade branch from 1ccbd7e to 8d7a5c4 Compare July 14, 2025 09:42
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jul 14, 2025

Router-nonroot image scan passed

✅ No security vulnerabilities found in image:

ghcr.io/wundergraph/cosmo/router:sha-b4412c872bfc6c43c86aac8081ace3ac985e27e8-nonroot

@SkArchon SkArchon closed this Jul 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants